﻿/***********************************************************************
 * <copyright file="NewsDescription.cs" company="VidaGIS">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Hoang Bich Son 
 * Email:    sonhb@vidagis.com or bichson2002@gmail.com
 * Website:
 * Create Date: Wednesday, November 26, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System;
using BusinessObjects;
using BusinessObjects.BusinessRules;

namespace BusinessNews
{
    /// <summary>
    /// NewsDescription class
    /// </summary>
    public class NewsDescription : BusinessObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NewsDescription"/> class.
        /// </summary>
        public NewsDescription()
        {
            AddRule(new ValidateId("NewsId"));
            AddRule(new ValidateId("LanguageId"));
            AddRule(new ValidateLength("Title", 0, 255));
            AddRule(new ValidateLength("Description", 0, 500));
            AddRule(new ValidateLength("MetaTitle", 0, 255));
            AddRule(new ValidateLength("MetaDescription", 0, 500));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="NewsDescription"/> class.
        /// </summary>
        /// <param name="newsId">The news identifier.</param>
        /// <param name="languageId">The language identifier.</param>
        /// <param name="title">The title.</param>
        /// <param name="description">The description.</param>
        /// <param name="metaTitle">The meta title.</param>
        /// <param name="metaKeyword">The meta keyword.</param>
        /// <param name="metaDescription">The meta description.</param>
        /// <param name="modifiedDate">The modified date.</param>
        public NewsDescription(long newsId, short languageId, string title, string description, string metaTitle, string metaKeyword, string metaDescription, DateTime? modifiedDate)
            : this()
        {

            NewsId = newsId;
            LanguageId = languageId;
            Title = title;
            Description = description;
            MetaTitle = metaTitle;
            MetaKeyword = metaKeyword;
            MetaDescription = metaDescription;
            ModifiedDate = modifiedDate;
        }

        /// <summary>
        /// Gets or sets the news.
        /// </summary>
        /// <value>
        /// The news.
        /// </value>
        public News News { get; set; }

        /// <summary>
        /// Gets or sets the news identifier.
        /// </summary>
        /// <value>
        /// The news identifier.
        /// </value>
        public long NewsId { get; set; }

        /// <summary>
        /// Gets or sets the language identifier.
        /// </summary>
        /// <value>
        /// The language identifier.
        /// </value>
        public short LanguageId { get; set; }

        /// <summary>
        /// Gets or sets the title.
        /// </summary>
        /// <value>
        /// The title.
        /// </value>
        public string Title { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets the meta title.
        /// </summary>
        /// <value>
        /// The meta title.
        /// </value>
        public string MetaTitle { get; set; }

        /// <summary>
        /// Gets or sets the meta keyword.
        /// </summary>
        /// <value>
        /// The meta keyword.
        /// </value>
        public string MetaKeyword { get; set; }

        /// <summary>
        /// Gets or sets the meta description.
        /// </summary>
        /// <value>
        /// The meta description.
        /// </value>
        public string MetaDescription { get; set; }

        /// <summary>
        /// Gets or sets the modified date.
        /// </summary>
        /// <value>
        /// The modified date.
        /// </value>
        public DateTime? ModifiedDate { get; set; }
    }
}
